<template>
  <aside class="sidebar">
    <!-- 导航标题 -->
    <div class="sidebar-header">
      <h2 class="logo">hfut管理</h2>
    </div>

    <!-- 导航菜单 -->
    <nav class="sidebar-menu">
      <ul>
        <li 
          v-for="(route, index) in routes" 
          :key="index"
          :class="{ active: $route.path === route.path }"
        >
          <router-link :to="route.path">
            {{ route.title }}
          </router-link>
        </li>
      </ul>
    </nav>
  </aside>
</template>

<script setup>
// 导航路由配置（与一级功能对应）
const routes = [
  { path: '/department', title: '部门管理' },
  { path: '/title', title: '职称管理' },
  { path: '/position', title: '职务管理' },
  { path: '/teacher', title: '教职工列表' },
  { path: '/report', title: '报表统计' }
]
</script>

<style scoped>
.sidebar {
  width: 200px;
  height: 100vh;
  background-color: #2c3e50; /* 深蓝色背景 */
  color: white;
  padding: 20px;
  position: sticky;
  top: 0;
}

.sidebar-header {
  margin-bottom: 30px;
  text-align: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #3498db; /* 蓝色标题 */
  margin-bottom: 20px;
}

.sidebar-menu ul {
  list-style: none;
  padding: 0;
}

.sidebar-menu li {
  margin: 10px 0;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.sidebar-menu li.active {
  background-color: #3498db; /* 激活背景色 */
}

.sidebar-menu li:hover {
  background-color: #34495e; /* 悬停背景色 */
  cursor: pointer;
}

.sidebar-menu a {
  display: block;
  padding: 10px 20px;
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
}
</style>